<html>

<head>
<?php 
session_start();	
$_SESSION['hallpass'] = true;	
	

	/*safe secret to avoid spoofed form submittion 
	 	if you look closely you can see a hidden type that will send a secret gift* */
	require_once "security.php";
	
	
	$secret = spoof_prevention();
	/*$arr = encrypt_me(0,0,1);
	$secret = $arr['password'];
	//$secret = md5(uniqid(rand(), true));
	$_SESSION['secret'] = $secret;*/
?>

<script type="text/javascript">
function suggestCompany(str)
{
var xmlhttp;    
if (str=="")
  {
  document.getElementById("txtHint").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","suggest.php?company="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>

<form action="register.php" method="post">

city: <input type="text" name="city" /><br>
company: <input type="text"  name="company" onkeyup="suggestCompany(this.value)"/><br>
education: <input type="text" name="edu" /><br>

<input type="hidden" name="secret" value="<? echo $secret; ?>" />  

<input type="submit" />
</form>
<br />
<div id="txtHint">Customer info will be listed here...</div>
</body>
</html> 